package basicas;

import java.util.Date;
import java.util.List;

import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;

import org.hibernate.annotations.Cascade;
import org.hibernate.annotations.CascadeType;
import org.hibernate.annotations.Fetch;
import org.hibernate.annotations.FetchMode;

import util.ObjetoSistema;

@Entity
public class Projeto{

	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	private int codProjeto;
	private String nome;
	@OneToOne
	@Cascade(CascadeType.ALL)
	private Professor orientador;
	@OneToOne
	@Cascade(CascadeType.ALL)
	private Equipe equipe;
	private String descricao;
	@ManyToMany
	@JoinTable(name = "projeto_expertises", joinColumns = { @JoinColumn(name = "codProjeto") }, inverseJoinColumns = { @JoinColumn(name = "codExpertise") })
	@Cascade(CascadeType.ALL)
	private List<Expertises> expertises;
	private int status;
	private Date dataInicio;
	private Date dataFim;
	@OneToMany(mappedBy = "projeto")
	@Cascade(org.hibernate.annotations.CascadeType.SAVE_UPDATE)
	private List<Comentario> comentarios;
	@OneToMany(mappedBy = "projeto")
	@Cascade(org.hibernate.annotations.CascadeType.SAVE_UPDATE)
	private List<Sprint> sprints;

	public Projeto() {
	}

	public String getNome() {
		return nome;
	}

	public void setNome(String nome) {
		this.nome = nome;
	}

	public Professor getOrientador() {
		return orientador;
	}

	public void setOrientador(Professor orientador) {
		this.orientador = orientador;
	}

	public Equipe getEquipe() {
		return equipe;
	}

	public void setEquipe(Equipe equipe) {
		this.equipe = equipe;
	}

	public String getDescricao() {
		return descricao;
	}

	public void setDescricao(String descricao) {
		this.descricao = descricao;
	}

	public List<Expertises> getExpertises() {
		return expertises;
	}

	public void setExpertises(List<Expertises> expertises) {
		this.expertises = expertises;
	}

	public int getStatus() {
		return status;
	}

	public void setStatus(int status) {
		this.status = status;
	}

	public Date getDataInicio() {
		return dataInicio;
	}

	public void setDataInicio(Date dataInicio) {
		this.dataInicio = dataInicio;
	}

	public Date getDataFim() {
		return dataFim;
	}

	public void setDataFim(Date dataFim) {
		this.dataFim = dataFim;
	}

	public List<Comentario> getComentarios() {
		return comentarios;
	}

	public void setComentarios(List<Comentario> comentarios) {
		this.comentarios = comentarios;
	}

	public List<Sprint> getSprints() {
		return sprints;
	}

	public void setSprints(List<Sprint> sprints) {
		this.sprints = sprints;
	}
}
